#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#define maxsize 1000
typedef int inte;
typedef struct queue
{   
    inte data[maxsize];//基址
    inte front;//头指针
    inte rear;//尾指针
}Queue;
//初始化队列
Queue * InitQueue(){
    Queue *s;
    s=(Queue *)malloc(sizeof(Queue));
    if(!s)
        return NULL;
    else{
        s->front=s->rear=0;
    }
    return s;
}
//入队
int push(Queue *s,int x){
        s->data[s->rear]=x;
        s->rear++;
  
    return 0;
}
//出队
int pop(Queue *s){
    if(s->front==s->rear)
    return 0;
    int x = s->data[s->front];
    s->front++;
    return x;
}
//get
int get(Queue *s){
    return s->data[s->front];
}
//销毁队列
Queue * destroyQueue(Queue *Q)
{
    free(Q);
    return NULL;
}
void print_y(int n,Queue *q){
    push(q,0);
    push(q,1);
    for(int k=1;k<=n;k++)
            printf(" ");
    printf("%d\n",1);
    for(int i=1;i<=n;i++){
        push(q,0);
        for(int k=1;k<=(n-i);k++)
            printf(" ");
        for(int j=0;j<=i;j++){
            int v = pop(q);
            v+=get(q);
            push(q,v);
            printf("%d ",v);
        }
        printf("\n");
    }
}
int main(){
    Queue *q;
    q=InitQueue();
    int n;
    printf("输入你要打印的行数");
    scanf("%d",&n);
    print_y(n,q);
}